package wang.aweb.childcar.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wang.aweb.childcar.model.dao.MemberMoneyLogMapper;
import wang.aweb.childcar.model.pojo.MemberMoneyLog;
import wang.aweb.childcar.service.MemberMoneyLogService;

import java.util.Date;
@Service
public class MemberMoneyLogServiceImpl implements MemberMoneyLogService {
    @Autowired
    private MemberMoneyLogMapper memberMoneyLogMapper;
    @Override
    public void add(Integer memberId,Integer money,Integer type,Integer endMoney){
        MemberMoneyLog memberMoneyLog=new MemberMoneyLog();
        memberMoneyLog.setMemberId(memberId);
        memberMoneyLog.setEndMoney(endMoney);
        memberMoneyLog.setCreateTime(new Date());
        memberMoneyLog.setPrice(money);
        memberMoneyLog.setType(type);
        memberMoneyLogMapper.insert(memberMoneyLog);
    }
}
